<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<p:dataTable var="product" value="#{productModel.list}"
		filteredValue="#{productModel.filteredList}" rowKey="#{product.id}"
		filterEvent="enter" rendered="#{productModel.isInitialized}" style="font-size:0.9em"
		paginator="true" rows="15" rowsPerPageTemplate="5,7,10,15,20,30,40,50"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
		<f:facet name="header">List of Product</f:facet>

		<p:column headerText="Checked" style="width:10px" sortBy="#{product.selected}">
			<p:selectBooleanCheckbox value="#{product.selected}">
				
					<p:ajax event="change" process="@this"></p:ajax>
			
			</p:selectBooleanCheckbox>
		</p:column>		

		<p:column headerText="No." sortBy="#{product.number}">
			<h:outputText value="#{product.number}" />
		</p:column>
		<p:column sortBy="#{product.chineseName}"
			filterBy="#{product.chineseName}" filterMatchMode="contains">
			<h:outputText value="#{product.chineseName}" />
		</p:column>
		<p:column sortBy="#{product.name}" filterBy="#{product.name}"
			filterMatchMode="contains">
			<h:graphicImage library="images" value="../#{product.icon}16.png"></h:graphicImage>
			<h:outputText value="#{product.name}" />
		</p:column>

		<p:column headerText="P." sortBy="#{product.price}">
			<h:outputText value="#{product.price}" />
		</p:column>
		<p:column headerText="SP. P." sortBy="#{product.specialPrice}">
			<h:outputText value="#{product.specialPrice}" />
		</p:column>
		<p:column headerText="INV." sortBy="#{product.inventory}">
			<h:outputText value="#{product.inventory}" />
		</p:column>
		<p:column sortBy="#{product.type.label}"
			filterBy="#{product.type.label}" filterMatchMode="contains">
			<h:outputText value="#{product.type.label}" />
		</p:column>
		<p:column headerText="? SP." sortBy="#{product.isOnSpecial}">
			<p:selectBooleanCheckbox disabled="true" value="#{product.isOnSpecial}">

			</p:selectBooleanCheckbox>
		</p:column>

	</p:dataTable>
</ui:composition>
</html>